using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Multiplicity
{
    public class MultiplicityAttribute : Attribute
    {
        private MultiplicityKind m_MulType = MultiplicityKind.Bare;
        private Type m_ContainerType = null; //only used for  MultiplicityType.Any

        public Type ContainerType
        {
            get
            {
                return m_ContainerType;
            }
        }

        public MultiplicityAttribute(MultiplicityKind pMulType, Type pContainerType = null)
        {
            m_MulType = pMulType;
            if (m_MulType == MultiplicityKind.Any)
                m_ContainerType = pContainerType;
        }

        public static bool EqualsName(string pAttributeName)
        {
            //string name = typeof(MultiplicityAttribute).Name;
            return pAttributeName.Equals("MultiplicityAttribute") || pAttributeName.Equals("Multiplicity");
        }
    }

    public enum MultiplicityKind
    {
        Bare,
        Optional,
        Any
    }
}
